# Maintainer : Christian Rebischke <Chris.Rebischke@archlinux.org>
# Contributor: Vlad M. <vlad@archlinux.net>
# Contributor: Patrice Peterson <runiq at archlinux dot us>
# Contributor: Vivien Didelot <vivien+aur@didelot.org>

pkgname=i3blocks
pkgver=1.5
pkgrel=4
pkgdesc='Define blocks for your i3bar status line'
arch=('loong64' 'x86_64')
groups=('i3')
url="https://github.com/vivien/i3blocks"
license=('GPL3')
makedepends=('git')
depends=('glibc')
source=("${pkgname}-${pkgver}::git+https://github.com/vivien/${pkgname}#tag=${pkgver}?signed"
	"i3blocks-1.5-fix-Makefile-bash-completion-dependency.patch")
sha512sums=('SKIP'
            'd3d21b200f71559156c994f94f2e05f92c61b807e7d4916f474730ad8e8769b813ecc1073b6cf7ab8ee5e6b13eed12c9d94d7d23d3c3bbb44943ebea28e504fd')
backup=('etc/i3blocks.conf')
validpgpkeys=('44C919BDF206CFDC49C7101A66C63FBDFD79670A')
install=i3blocks.install

prepare () {
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i ${srcdir}/i3blocks-1.5-fix-Makefile-bash-completion-dependency.patch
}

build () {
  cd "${pkgname}-${pkgver}"
  ./autogen.sh
  ./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc
  make VERSION="${pkgver}"
}

package () {
  cd "${pkgname}-${pkgver}"
  make VERSION="${pkgver}" DESTDIR="${pkgdir}" install
}
